package com.dykj.fireFighting.server.base.enterprise.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dykj.fireFighting.api.base.enterprise.entity.Enterprise;
import com.dykj.fireFighting.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 企业信息表
 *
 * @author JacksonTu
 * @date 2018-12-11 13:49:00
 */
public interface EnterpriseMapper extends SuperMapper<Enterprise> {

    /**
     * 多表信息查询
     *
     * @param params
     * @return
     */
    List<Map<String, Object>> selectEnterpriseList(@Param("ew") Map<String, Object> params);

    /**
     * 获取所属地区单位
     *
     * @param params
     * @return
     */
    List<Enterprise> queryListByAreaCode(Map<String, Object> params);
    List<Enterprise> queryListByAreaCodeOne(Map<String, Object> params);
    List<Enterprise> queryListByIndustryCode(Map<String, Object> params);


    List<Enterprise> queryUnitSelect(String centerUnitId);

    List<Enterprise> querySocialByBindCodes(@Param("bindingCode") String bindingCode);

    IPage querySocialByBindCodesPage(Page page, @Param("params")HashMap<String, Object> params);

    List<String> queryBindCodeByUnitAreaCode(@Param("areaCode") String areaCode);



    /**
     * 根据维保单位获取社会单位
     *
     * @param enterpriseId
     * @return
     */
    List<Enterprise> queryUnitListByMaintenance(@Param("enterpriseId") String enterpriseId);

    List<Enterprise> querySocialUnits(@Param("params") HashMap<String, Object> params);

    /**
     * 根据社会单位获取维保单位
     *
     * @param params
     * @return
     */
    List<Enterprise> queryMaintenanceListByUnit(@Param("params") Map<String, Object> params);

    Enterprise queryInfoByBindingCode(@Param("bindingCode") String bindingCode);


    List<Enterprise> queryAllSocialUnits();


    Integer getSocialNum(long unitId);

    Integer getSocialOnlineNum(long unitId);

    Enterprise queryById(@Param("id") String id);

    List<Enterprise> queryByIds(@Param("unitIdList") List<String> unitIdList);
}
